<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="../include/conn.asp" -->
<!--#include file="contentfun.asp" -->
<%
call chkAdmin("|13")
id=request.querystring("Cid")
  set rs=server.createobject("adodb.recordset") 
  sql="select * from content where Cid="&id
  rs.open sql,conn,1,1
  if id="" or not isnumeric(id) then
  alertmsgandgo "没有这条记录","-1"
  end if
  if not rs.eof then	
	  Cid=rs("Cid")
	  sortid=rs("sortid")
	  sorttype=rs("sorttype")
	  TopSortID=rs("TopSortID")
	  title=rs("title")
	  titlecolor=rs("titlecolor")
	  isoutlink=rs("isoutlink")
	  outlink=rs("outlink")
	  author=rs("author")
	  laiyuan=rs("laiyuan")
	  content=rs("content")		
	  isok=rs("isok")		
	  istop=rs("istop")		
	  tuijian=rs("tuijian")		
	  tuwen=rs("tuwen")		
	  isheadline=rs("isheadline")		
	  isfeatured=rs("isfeatured")		
	  px_id=rs("px_id")		
	  isgenerated=rs("isgenerated")		
	  visits=rs("visits")		
	  addtime=rs("addtime")		
	  imagepath=rs("imagepath")		
	  img=rs("img")		
	  downurl=rs("downurl")		
	  pagetitle=rs("pagetitle")
	  pagekeywords=rs("pagekeywords")		
	  pagedesc=rs("pagedesc")
	  yrmb=rs("yrmb")
	  xrmb=rs("xrmb")			
	  isnocomment=rs("isnocomment")			
	  star=rs("star")							
  end if	
%>
<!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3c.org/tr/1999/rec-html401-19991224/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>修改<%=sorttypename%></title>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<link rel="stylesheet" type="text/css" id="css" href="images/style.css">
<script type="text/javascript" src="../js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="DatePicker/WdatePicker.js"></script>
<link rel="stylesheet" href="../ZKeditor/themes/default/default.css" />
<link rel="stylesheet" href="../ZKeditor/plugins/code/prettify.css" />
<script type="text/javascript" src="../ZKeditor/kindeditor.js"></script>
<script type="text/javascript" src="../ZKeditor/plugins/code/prettify.js"></script>
<script type="text/javascript">
KindEditor.ready(function(K) {
    var editor = K.create('textarea[name="content"]', {
        cssPath : '../ZKeditor/plugins/code/prettify.css',
        uploadJson : '../ZKeditor/asp/upload_json.asp',
        fileManagerJson : '../ZKeditor/asp/file_manager_json.asp',
		//urlType : 'relative',
		allowFileManager : true,
        afterCreate : function() {
	K('#insertHtml').click(function(e) {
		editor.insertHtml('[==华==丽==的==分==页==码==]');
	});
        },
		afterBlur: function(){this.sync();}
		
    });
    prettyPrint();

});
</script>
<script type="text/javascript">
function check(form) {
	if(form.local.checked) {//判断选中时执行
		 // alert("地址不能为空!");
		  document.getElementById('one').innerHTML='<font color="#FFF">远程图片正在本地化...请等待！</font>';
		  form.local.focus();
		  //return false;  //注释后继续执行
	 }
return true;
}

/*设置图片缩略图*/
function setimg(t)
{
document.getElementById("img").value=t
}
/*删除图片*/
function dropThisDiv(t,p)
{
document.getElementById(t).style.display='none'
var str =document.getElementById("ImagePath").value;
var arr = str.split("|");
var nstr="";
for (var i=0; i<arr.length; i++)
{
	if(arr[i]!=p)
	{
		if (nstr!="")
		{
			nstr=nstr+"|";
		}		
		nstr=nstr+arr[i]
	}
}
document.getElementById("ImagePath").value=nstr;
}
/*设置增加图组*/
function valMsg(strValue){
	if (strValue=="") return;
	var objLinkUpload =document.getElementsByName("ImagePath")[0];
	if (objLinkUpload){
		if (objLinkUpload.value!=""){
			objLinkUpload.value = objLinkUpload.value + "|";
		}
		objLinkUpload.value = objLinkUpload.value + strValue;
	}
}
/*浏览图片返回*/
KindEditor.ready(function(K) {
var editor = K.editor({
	fileManagerJson : '../ZKeditor/asp/file_manager_json.asp'
});
K('#flash').click(function() {
	editor.loadPlugin('filemanager', function() {
		editor.plugin.filemanagerDialog({
			viewType : 'VIEW',
			dirName : 'image',
			urlType : 'relative',
			clickFn : function(url, title) {
				K('#img').val(url);
				var pw=document.getElementById("pw").innerHTML;
				var ids=url
				   ids=ids.substr(ids.lastIndexOf("/")+1,ids.lastIndexOf("."))
				   ids=ids.replace(".","")
				var div=pw+'<div class="imgDiv" id="'+ids+'"><label><img src="'+ url + '" border="0" /><br><input type="radio" name="imgradio" onclick="setimg(\''+url+'\')" value="'+url+'" />设为缩略图</label> <a href="javascript:dropThisDiv(\''+ids+'\',\''+url+'\')">删除</a></div>'
				
				K('#pw').html(div);
				K('#ImagePath').val(valMsg(url));
				editor.hideDialog();
			}
		});
	});
}); 
K('#annex').click(function() {
	editor.loadPlugin('filemanager', function() {
		editor.plugin.filemanagerDialog({
			viewType : 'VIEW',
			dirName : 'file',
			urlType : 'relative',
			clickFn : function(url, title) {
				K('#downurl').val(url);
				editor.hideDialog();
			}
		});
	});
});
  });
</script>
<style type="text/css">
<!--
#pw{position:relative; overflow:hidden; display:inline-block;background:#FFF;border-right:1px #CCC solid}
.imgDiv{float:left; padding:5px;border:1px #ccc solid; background:#F2F2F2;margin-right:-1px}
.imgDiv img{width:110px;height:70px; margin:0px auto;border:1px #CCC solid}
.imgDiv img:hover{ border:1px #CC0000 solid}
-->
</style>
</head>
<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<form name="add" onSubmit="return check(this)" action="?action=edit<%="&sorttype="&sorttype&"&sortid="&sortid&"&keyword="&keyword&"&page="&page&"&psize="&psize&"&order="&order&"&ordsc="&ordsc&"&id="&Cid&""%>" method="post" >
  <tr>
    <td  height="30" class="topnav"><div>修改<%=sorttypename%></div></td>
  </tr>
  <tr>
    <td bgcolor="#ffffff">
    <table width="100%" border=0 align=center cellpadding=2 cellspacing=0 class="stable">
  <tbody>
  <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td width="120" height=30  align=right class=td>频道分类</td>    
    <td class=td><%loadselect "sortid","zych_type","sortname","sortid",sortid, 0,"and TopSortID="&TopSortID&" order by px_id","请选择分类",0,"onChange=""changelocation(document.form.sortid.options[document.form.sortid.selectedIndex].value,document.form)"""%>
    标题颜色<input id="colorPicker"  name="titlecolor" type="text" value="<%=titlecolor%>" style="width:80px"  class="inp"/> 
    文章ID：<font color="#990000"><%=Cid%></font>  所属频道：<font color="#990000"><%=SortNames(TopSortID)%></font> 应所属模型：<font color="#990000"><%= SchannelID(sortid) %></font>  现属模型：<font color="#990000"><%= sorttypenames(sorttype) %></font>  </td>
    <script src="images/Deepteach_colorPicker.js"></script>
    </tr>
  <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">						
    <td width="120"  height=30 align=right class=td>文章标题</td>
    <td class=td><input name="title" class="inp" id="title" style="width:350px" value="<%=title%>" maxlength="200" /> 您已输入<span style="color:#C00" id="info"> </span>/200 <font color=#ff0000>*</font>
<script> /*标题字数*/
$(function(){
document.getElementById("info").innerText =<%=(length(title)/2+1)%>; 
document.getElementById("title").onkeyup = function() 
{ 
document.getElementById("info").innerText = document.getElementById("title").value.length; 
} 
});
</script></td>
  </tr>   
 <%	if sorttype="2" then%>
  <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td width="120"  height=30 align=right class=td>文章作者</td>
    <td class=td><input class="inp" maxlength="200" style="width:160px" name="author" value="<%=author%>"/> 来源 <input class="inp" maxlength="200" style="width:160px" name="laiyuan" value="<%=laiyuan%>"/> 浏览次数<input class="inp" maxlength="6" value="<%=visits%>" style="width:60px" name="visits"/>
排序<input class="inp" maxlength="6" style="width: 60px" name="px_id" value="<%=px_id%>"/>
</td>
    </tr>
<%end if%>
   <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td align=right class=td>关键词</td>
    <td class=td><%=fileext%>
      <input type="hidden" name="isgenerated" value="1" /><input class="inp" maxlength="200" style="width:450px"  name="pagekeywords" value="<%=pagekeywords%>"/> <input type="button" class="btn" onClick="lastIndexDemo();"  value="提取关键词"/></td>
  </tr>
  <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td align=right class=td>页面描述</td>
    <td class=td>  <textarea class="tex" style="width:450px" name="pagedesc" rows="3"><%=pagedesc%></textarea>    </td>
  </tr>
  <%if sorttype=4 then%>
<td class="td" align="right" height="30">原价</td>
<td class="td" colspan="3"> <input type="text" class="inp" maxlength="100" value="<%=yrmb%>" name="yrmb" style="width:200px">
</td>
</tr>
<tr>
<td class="td" align="right" height="30">现价</td>
<td class="td" colspan="3"> <input type="text" class="inp" maxlength="100" value="<%=xrmb%>" name="xrmb" style="width:200px">
</td>
</tr>
<% End If %>
 <%=getfield(Cid,TopSortID)%>
  <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td align=right class=td>外链地址  </td>
    <td class=td><input class="inp" maxlength="200" style="width:200px" name="outlink" value="<%=outlink%>"/>
      <label class="inp"><input type="checkbox" name="isoutlink" value="1"<% if isoutlink then echo"checked=""checked"""%> /> 转向链接</label></td>
    </tr> 
  <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td align=right class=td>内容详情<br><a href="javascript:void(0)" id="insertHtml">插入分页</a></td>
    <td class=td><textarea  name="content" id="content" rows="3" style="width:750px; height:400px"><%=Content%></textarea></td>
  </tr>
    <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td align=right valign="middle" class=td>缩略图</td>
      <td class=td ><label class="inp"><input name="simg" type="radio" value="1" onClick="Date1.style.display='none'" <% if isnul(img) then %>checked<%end if%>/>使用第一张图做为缩略图</label> 
     			   <label class="inp"><input name="simg" type="radio" value="2" onClick="Date1.style.display=''" <%if img<>"" or imagepath<>"" then%>checked<%end if%>/>重新上传</label></td>
</tr>
	
<tr id="Date1" <%if isnul(img) then %>style="display:none<%end if%>" onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td align=right valign="middle" class=td>图片组</td>
      <td class=td><table width="200" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><input class="inp" style="width:350px" name="img" type="text" id="img" size="40"value="<%=img%>"/></td>
    <td> <input name="flash" type="button" class="button" id="flash" value="选取已上传" /></td>
    <td><iframe src="up.asp?formname=add&inputname=img&uploadstyle=News" frameborder="0" scrolling="no" width="250" height="28"></iframe></td>
  </tr>
</table>
<input name="ImagePath" type="hidden" id="ImagePath" value="<%=ImagePath%>" size="60"/>
<div id="pw">
<%if ImagePath<>"" then 
dim ii,images
	images=split(ImagePath,"|")
	for ii=0 to ubound(images)
	response.write "<div id=""img"&ii&""" class=""imgDiv""><label><img border=""0"" src="""&images(ii)&"""><br><input type=""radio"" value="""&images(ii)&""" onclick=""setimg('"&images(ii)&"')"" name=""imgradio"">设为缩略图</label> <a href=""javascript:dropThisDiv('img"&ii&"','"&images(ii)&"')"">删除</a></div>"
next
end if%>
</div>
</td>
    </tr>
  <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td class=td align=right width=120 height=30>附件地址</td>
    <td class=td><table width="200" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td><input class="inp" maxlength="255" style="width:350px;float:left" id="downurl"  name="downurl" value="<%=downurl%>" /></td>
        <td><input name="flash" type="button" class="button" id="annex" value="选取已上传" /></td>
        <td><iframe style="float:left" src="up.asp?formname=add&amp;inputname=downurl&amp;uploadstyle=file" frameborder="0" scrolling="no" width="250" height="28"></iframe></td>
      </tr>
    </table>
         </td>
  </tr>
    <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td width="120" height=30 align=right class=td>阅读权限</td>
    <td class=td>
    <select name="star" class="sel">
        <option value="0"<%if star=0 then echo" selected"%>>网站游客</option>
		<%set rsc=server.CreateObject("adodb.recordset")
        rsc.open "select * from user_fl order by px_id asc",conn,1,1
		if rsc.eof then
		response.write""
		else
        while not rsc.eof
        if star=rsc("id") then sel=" selected" else sel=""
        response.Write("<option value="""&rsc("id")&""""&sel&">"&rsc("title")&"</option>")      
        rsc.movenext
        wend
		end if
        rsc.close
        set rsc=nothing%> 
     </select></td>
    </tr>
  <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td width="120" height=30 align=right class=td>发布时间</td>
    <td class=td><input class="sel" maxlength="10" style="width:120px" onClick="WdatePicker({dateFmt:'yyyy/MM/dd HH:mm:ss'})"  name="addtime" value="<%=addtime%>"/><input name=button type=button class="btn" onClick="document.add.addtime.value='<%=(now)%>'" value="设为当前时间"></td>
    </tr>
  <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td width="120" height=30 align=right class=td>功能选项 </td>
    <td class=td><label class="inp"><input type="checkbox" name="istop" <%if istop then echo"checked=""checked"""%> value="1"/>置顶</label>
<label class="inp"><input type="checkbox" name="tuijian" <% if tuijian then echo"checked=""checked"""%> value="1"/>推荐</label> 
<label class="inp"><input type="checkbox" name="tuwen" <% if tuwen then echo"checked=""checked"""%> value="1"/>图文</label>
<label class="inp"><input type="checkbox" checked="checked" name="isok" <% if isok then echo"checked=""checked"""%> value="1"/>发布</label>
<label class="inp"><input name="local" type="checkbox"  id="local" value="1">远程图片到本地</label> <span id="one">远程下载图片需要时间，可能会有延迟!</span>
</td>
  </tr>

  
 
  <tr onMouseOver="style.backgroundcolor='#eeeeee'" onMouseOut="style.backgroundcolor='#ffffff'" bgcolor="#ffffff">
    <td width="120" height=30 align=right class=td>&nbsp;</td>
    <td class=td> <input type="hidden" maxlength="200"  name="Cid" value="<%=Cid%>"/> 
<input type="hidden" maxlength="200"  name="sorttype" value="<%=sorttype%>"/> 
<input class="btn" type="submit" value=" 更 新 " />
<input class="btn" type="button" value=" 返 回 " onClick="history.go(-1)"/> </td>
    </tr> 
    </tbody></table>
</td>
  </tr>
</form>
</table>
<%call footer%>
</body>
</html>